package com.heima.common.exception;

import com.heima.model.common.enums.AppHttpCodeEnum;

/**
 * @author Jt
 * @date 2021/4/10 19:08
 */
public class CustomException extends RuntimeException {

//    异常处理的枚举
    private AppHttpCodeEnum appHttpCodeEnum;

    public CustomException(AppHttpCodeEnum appHttpCodeEnum) {
        this.appHttpCodeEnum = appHttpCodeEnum;
    }

    public CustomException(AppHttpCodeEnum appHttpCodeEnum,String msg) {
        this.appHttpCodeEnum = appHttpCodeEnum;
        this.appHttpCodeEnum.setErrorMessage(msg);
    }

    public AppHttpCodeEnum getAppHttpCodeEnum () {
        return appHttpCodeEnum;
    }

}
